/*
 * @Author: 颜礼田 2564217790@qq.com
 * @Date: 2024-09-06 18:22:28
 * @LastEditors: MrDotYan 2564217790@qq.com
 * @LastEditTime: 2024-09-20 18:24:37
 * @FilePath: /webServer/src/interface.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import '@midwayjs/core';
/**
 * * 拓展参数
 */
declare module '@midwayjs/core' {
  interface Context {
    header: {
      uid?: string;
      sign?: string;
      time?: string;
    };
  }
}

/**
 * * 列表请求参数
 */
export interface ListParams<T> {
  pageNum: number;
  pageSize: number;
  sortField?: string;
  sortMethod?: string;
  search?: T;
}

/**
 * token 配置
 */
export interface JwtConfigInterface {
  algorithm: Algorithm;
  secret: string;
  expiresIn: string;
}

export type Algorithm =
  | 'HS256'
  | 'HS384'
  | 'HS512'
  | 'RS256'
  | 'RS384'
  | 'RS512'
  | 'ES256'
  | 'ES384'
  | 'ES512'
  | 'PS256'
  | 'PS384'
  | 'PS512'
  | 'none';

/**
 * 静态文件
 */

export interface StaticFileConfig {
  dirs: {
    default: {
      prefix: string;
      dir: string;
    };
  };
}

/**
 * d登录实体
 */
export interface Login {
  username: string;
  password: string;
}

export interface TreeNode {
  children: TreeNode[];
  [key: string]: any;
}
